<template>
  <div class="mui-numbox" data-numbox-min="1" :data-numbox-max="max" :style="myStyle">
    <button class="mui-btn mui-btn-numbox-minus" type="buttin">-</button>
    <input class="mui-input-numbox" type="number" :value="initcount" ref="num" />
    <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
  </div>
</template>
<script>
import mui from '../lib/mui/js/mui.min.js'
export default {
  data() {
    return {
      myStyle: {}
    }
  },
  mounted() {
    mui('.mui-numbox').numbox()
    if (this.$props.siza === "min") {
      this.myStyle = { heigth: "25px", margin: "0 10px 0px 10px" };
    }
  },
  props: ['initcount', 'max', 'goodslist', 'size'],

  watch: {
    'max'(newVal) {
      mui('.mui-numbox').numbox().setOption('max', newVal);
    }
  }
}
</script>